<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Index/css/vip_order.css">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Index/css/ordered.css">
	<script type="text/javascript" src="__PUBLIC__/Index/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="__PUBLIC__/Index/js/vip.js"></script>
	<script type="text/javascript">
		var status="<?php echo U('Order/status');?>";
	</script>
</head>
<body>
	<div id='v_banner'>
		<ul>
			<li><a href='' class='a_on'><span class='s_on'>我的订单</span></a></li>
			<li><a href=''><span>充值缴费</span></a></li>
			<li><a href=''><span>礼品卡</span></a></li>
			<li><a href=''><span>机票</span></a></li>
			<li><a href=''><span>酒店</span></a></li>
			<li><a href=''><span>保险</span></a></li>
			<li><a href=''><span>电子书刊</span></a></li>
		</ul>
	</div>
	<div id='status'>
		<select name='order'>
			<option>最近一个月的订单</option>
			<option selected='selected'>所有订单</option>
		</select>
		<select name='status'>
			<option>所有状态</option>
			<option value='1'>等待付款</option>
			<option value='2'>支付完成</option>
		</select>
		<input class='search' type='text' name='search' value='商品名称/订单号'/>
		<input class='search_btn' type='submit' value='筛选'/>
	</div>
	<div id='v_content'>
		<table>
			<tr>
				<th width="10%">订单号</th>
				<th width="30%">商品</th>
				<th width="10%">金额（元）</th>
				<th width="15%">下单时间</th>
				<th width="10%">订单状态</th>
				<th width="20%" style='border-right:1px solid #E8E7E7;'>操作</th>
			</tr>
			<?php $time=0;$status='';$oid=0;?>
			<?php if(is_array($result)): foreach($result as $k=>$v): ?><tr><?php $price=0; ?>
					<td><?php echo ($k); ?></td>
					<td>
						<?php if(is_array($v)): foreach($v as $key=>$value): ?><p><img width='50px' height='50px' src="__ROOT__/Uploads/List/<?php echo ($value["listpic"]); ?>"/><a href="<?php echo U('Show/index',array('id'=>$value['gid']));?>" title="<?php echo ($value["name"]); ?>(<?php echo ($value["mark"]); ?>)" target='_top'><?php echo ($value["name"]); ?>(<?php echo ($value["mark"]); ?>)</a> <br/>¥ <?php echo (number_format($value['subtotal']/$value['quantity'],2)); ?> × <?php echo ($value["quantity"]); echo ($value["unit"]); ?><p>
								
								<?php $price=$value['total'];$time=$value['time'];$status=$value['status'];$oid=$value['oid']; endforeach; endif; ?>
					</td>
					<td style='font-size:14px; font-weight:600'>
						<?php echo (number_format($price,2)); ?>
					</td>
					<td><?php echo (date('Y-m-d H:i',$time)); ?></td>
					<td style='color:#FF6600;'><?php echo ($status); ?></td>
					<td><?php switch($status): case "待付款": ?><a class='zhifu' id='v_pay' style="padding-right:19px;padding-left:19px;" href="<?php echo U('pay',array('oid'=>$oid));?>">支&nbsp;付</a><?php break;?>
							<?php case "已发货": ?><a href="<?php echo U('sure',array('oid'=>$oid));?>" class='zhifu' id="sure">确认收货</a><?php break; endswitch;?>

						
					</td>
				</tr><?php endforeach; endif; ?>
		</table>	
	</div>

	<div id='buy'>
	<p><a class='sub' oid="<?php echo ($_GET['id']); ?>">确定支付</a><a>取消支付</a></p>
</div>	
<div id='wind'></div>
</body>
</html>